<?php

/**
 * Vehiculo form base class.
 *
 * @method Vehiculo getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseVehiculoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'patente'          => new sfWidgetFormInputText(),
      'a��o'         => new sfWidgetFormInputText(),
      'motor'            => new sfWidgetFormInputText(),
      'chasis'           => new sfWidgetFormInputText(),
      'peso'             => new sfWidgetFormInputText(),
      'valuacion'        => new sfWidgetFormInputText(),
      'marca'            => new sfWidgetFormInputText(),
      'tipo'             => new sfWidgetFormInputText(),
      'modelo'           => new sfWidgetFormInputText(),
      'contribuyente_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contribuyente'), 'add_empty' => false)),
      'tipo_vehiculo_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TipoVehiculo'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'patente'          => new sfValidatorString(array('max_length' => 10)),
      'a��o'         => new sfValidatorInteger(array('required' => false)),
      'motor'            => new sfValidatorString(array('max_length' => 15)),
      'chasis'           => new sfValidatorString(array('max_length' => 20)),
      'peso'             => new sfValidatorInteger(array('required' => false)),
      'valuacion'        => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'marca'            => new sfValidatorString(array('max_length' => 25)),
      'tipo'             => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'modelo'           => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'contribuyente_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Contribuyente'))),
      'tipo_vehiculo_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TipoVehiculo'))),
    ));

    $this->widgetSchema->setNameFormat('vehiculo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Vehiculo';
  }

}
